<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <script src="http://www.itxst.com/package/jquery-3.3.1/jquery.js"></script>
    <link href="http://www.itxst.com/package/bootstrap-4.3.1/css/bootstrap.css" rel="stylesheet" />
    <link href="http://www.itxst.com/package/bootstrap-table-1.15.3/bootstrap-table.css" rel="stylesheet" />
    <script src="http://www.itxst.com/package/bootstrap-table-1.15.3/bootstrap-table.js"></script>
    <title>bootstrap table insertRow在线例子</title>
    <style>
        .table-demo {
            width: 80%;
            margin: 30px auto 0px auto;
        }
        .titles {
            float: right;
            clear: both;
        }
    </style>
</head>
<body>

<div class="table-demo">
    <table id="table"  ></table>
</div>
<script>
    //设置需要显示的列
    var columns = [

        {
            field:"id",
            title: 'ID'
        }, {
            field: 'title',
            title: '书名'
        } ];
    var data= [
        {
            "id": 1,
            "isbn": "123132123123",
            "title": "testBook",
            "author": "wei",
            "status": true,
            "description": "测试书籍",
            "publishingHouse": "人民邮电出版社",
            "location": "学科楼306",
            "loan": true,
            "borrowerId": 1
        },
        {
            "id": 2,
            "isbn": "12312414",
            "title": "1fgadfg",
            "author": "wei",
            "status": true,
            "description": "测试书籍3233",
            "publishingHouse": "人民邮电出版社",
            "location": "学科楼306",
            "loan": true,
            "borrowerId": 1
        },
        {
            "id": 3,
            "isbn": "123132123123",
            "title": "asdfasdf",
            "author": "wei",
            "status": true,
            "description": "safdsdfasdf",
            "publishingHouse": "人民邮电出版社",
            "location": "学科楼306",
            "loan": true,
            "borrowerId": 1
        },
        {
            "id": 4,
            "isbn": "123132123123",
            "title": "safasfd",
            "author": "wei",
            "status": true,
            "description": "asdf",
            "publishingHouse": "人民邮电出版社",
            "location": "学科楼306",
            "loan": true,
            "borrowerId": 1
        },
        {
            "id": 5,
            "isbn": "123132123123",
            "title": "jtfjty",
            "author": "wei",
            "status": true,
            "description": "asdfasdf",
            "publishingHouse": "人民邮电出版社",
            "location": "学科楼306",
            "loan": true,
            "borrowerId": null
        },
        {
            "id": 6,
            "isbn": "123132123123",
            "title": "sdfg",
            "author": "wei",
            "status": true,
            "description": "fasdgfdahfgj",
            "publishingHouse": "人民邮电出版社",
            "location": "学科楼306",
            "loan": true,
            "borrowerId": null
        },
        {
            "id": 7,
            "isbn": "123132123123",
            "title": "sfdh",
            "author": "wei",
            "status": true,
            "description": "adfashfgdhgj",
            "publishingHouse": "人民邮电出版社",
            "location": "学科楼306",
            "loan": false,
            "borrowerId": null
        },
        {
            "id": 8,
            "isbn": "123132123123",
            "title": "sdfe4",
            "author": "wei",
            "status": true,
            "description": "hkj",
            "publishingHouse": "人民邮电出版社",
            "location": "学科楼306",
            "loan": true,
            "borrowerId": null
        },
        {
            "id": 9,
            "isbn": "123132123123",
            "title": "fgh",
            "author": "wei",
            "status": true,
            "description": "hjgk",
            "publishingHouse": "人民邮电出版社",
            "location": "学科楼306",
            "loan": false,
            "borrowerId": null
        },
        {
            "id": 10,
            "isbn": "123132123123",
            "title": "dfgsd",
            "author": "wei",
            "status": true,
            "description": "fgdasga",
            "publishingHouse": "人民邮电出版社",
            "location": "学科楼306",
            "loan": false,
            "borrowerId": null
        }
    ]

    //bootstrap table初始化数据
    $('#table').bootstrapTable({
        toolbar:"#toolbar",
        data:data,
        columns: columns,
    });



</script>
</body>
</html>